package fr.emn.fil.soc.gr3.restws;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class DBConnection {

	private EntityManagerFactory emf;
	private EntityManager em;

	public EntityManager createConnection() {
		emf = Persistence.createEntityManagerFactory("socdb");
		em = emf.createEntityManager();
		return em;
	}

	public void closeConnection() {
		em.close();
		emf.close();
	}

}
